<template>
    <div class="new-content">
        <h2>{{con.title}}--{{id}}</h2>
        <p class="subtitle">
            <span>发表时间:{{con.ctime|timename}}</span>
            <span>点击{{con.click}}次</span>
        </p>
        <hr>
        <div class="content" v-html="con.content">
           
        </div>
        <!-- <my-button type="danger" size="larger" @click="getMore"></my-button> -->
        <subcompent :id="this.id"></subcompent>
    </div>
</template>
<script>
import subcompent from '../subcomponents/plun.vue'
export default {
    data(){
        return{
            id: this.$route.params.id,
            con:{}
        }
    },
    created(){
       this.getcon()
    },
    methods:{
        getcon(){
            this.$http.get("http://localhost:3030/list/"+this.id).then(result=>{
                var con1=result.body
                this.con=con1
            })
        },
        getMore(){
            this.pageIndex++;
            this.getcon()
        }
    },
    components:{
        subcompent
    }
}
</script>


<style  scoped>
.new-content{
    padding:50px 5px;
    padding-top: 0;
    }
h2{
      font-size: 16px;
      margin: 15px 0;
      color:red;
      text-align: center
    }
.subtitle{
      display: flex;
      font-size: 12px;
      justify-content: space-between;
    }

</style>


